﻿using System.Reflection;

namespace Borg
{
    internal class DeregisterPluginTask : Task<PluginInfo>
    {
        public DeregisterPluginTask(PluginInfo obj, uint taskGroupId, Assembly initiator)
            : base(obj, taskGroupId, initiator)
        { }

        public override void Execute()
        {
            obj.InternalDeregister(initiator, false);
        }

        public override string ToString()
        {
            return string.Format("{0}: {1}.InternalDeregister()", taskGroupId, obj);
        }

        public override string Name
        {
            get { return string.Format("DeregisteringPlugin({0})", obj.Name); }
        }
    }
}

